package com.jy.api.domain;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;
import lombok.ToString;

/**
 * 威富通支付结果基类
 * <p>
 * 由于威富通API设计问题，其不同接口返回的支付结果格式不一致。
 */
@Data
@ToString
public abstract class SwiftPassBaseResult {
    @XStreamAlias("version")
    protected String version;

    @XStreamAlias("charset")
    protected String charset;

    @XStreamAlias("sign_type")
    protected String signType;

    @XStreamAlias("status")
    protected String status;

    @XStreamAlias("message")
    protected String message;

    @XStreamAlias("total_fee")
    protected int totalFee;

    @XStreamAlias("trade_type")
    protected String tradeType;

    @XStreamAlias("time_end")
    protected String timeEnd;

    @XStreamAlias("transaction_id")
    protected String transactionId;

    @XStreamAlias("out_transaction_id")
    protected String outTransactionId;

    @XStreamAlias("out_trade_no")
    protected String outTradeNo;

    public abstract boolean isSuccess();

    public abstract boolean isNeedQuery();

    public abstract boolean isFailed();
}
